home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C / Code Resources / SliderCDEF 1.0 / SliderCDEF Source ƒ / SliderCDEF.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-10  |  3.3 KB  |  105 lines  |  [TEXT/KAHL]

  1. #include <Start.h>
  2. #include <QDOffscreen.h>
  3. #include <Retrace.h>
  4.  
  5. // These values appear in the contrlValue field of a button control's record. (?)
  6. #define kInvisible    0
  7. #define kVisible    255
  8. #define kInactive    255
  9.  
  10. // Width of the slider's indicator in pixels.
  11. #define kThumbSize    40
  12.  
  13. #define kVBLCount   1
  14.  
  15. pascal long GetVBLRec(void)
  16.     = 0x2E88;
  17.  
  18. typedef struct VBLRec {
  19.     VBLTask    xVBLTask;
  20.     Boolean        xDoTask;
  21.     long        vblA5;      // 4 bytes before the VBLTask data
  22. } VBLRec, *VBLRecPtr;
  23.  
  24.  
  25. // This structure will be allocated during initialization, and
  26. // a handle to it will be stored in the contrlData field of the
  27. // control record.
  28. typedef struct SliderDataRec {
  29.     GWorldPtr        sliderPort;
  30.     Rect            sliderPortRect;
  31.     Rect            sliderTrackRect;
  32.     Rect            sliderThumbRect;
  33.     Rect            sliderRect;
  34.     GWorldPtr        currPort;
  35.     GDHandle        currDev;
  36. } SliderDataRec, *SliderDataPtr, **SliderDataHnd;
  37.  
  38.  
  39. // These colors will be used a lot, so they're put together in a structure.
  40. typedef struct SliderColors {
  41.     RGBColor    black;
  42.     RGBColor    white;
  43.     RGBColor    darkGray;
  44.     RGBColor    lightGray;
  45.     RGBColor    darkColor;
  46.     RGBColor    lightColor;
  47. } SliderColors, *SliderColorsPtr, **SliderColorsHnd;    
  48.  
  49.  
  50. // When the thumbCntl message is received, param contains a
  51. // pointer to this structure.
  52. typedef struct ThumbCntlRec {
  53.     Rect        limitRect;
  54.     Rect        slopRect;
  55.     short    axis;
  56. } ThumbCntlRec, *ThumbCntlRecPtr, **ThumbCntlRecHnd;
  57.  
  58.  
  59. // SliderCDEF.c
  60. pascal long SliderCDEF( short varCode, ControlHandle theControl, short message, long param );
  61.  
  62. // SliderDrawControl.c
  63. void SliderDrawControl( short varCode, ControlHandle theControl, long param );
  64. void SliderDrawControlTrack( ControlHandle theControl, SliderColors *colors );
  65. void SliderDrawControlThumb( ControlHandle theControl, SliderColors *colors );
  66. void SliderDrawControlValue( ControlHandle theControl, SliderColors *colors );
  67. void SliderDrawControlInactive( short varCode, ControlHandle theControl, long param );
  68. void SliderBlitControl( ControlHandle theControl, SliderColors *colors );
  69.  
  70. // SliderTestControl.c
  71. long SliderTestControl( short varCode, ControlHandle theControl, long param );
  72.  
  73. // SliderCalcCRgns.c
  74. void SliderCalcCRgns( short varCode, ControlHandle theControl, long param );
  75.  
  76. // SliderInitControl.c
  77. void SliderInitControl( short varCode, ControlHandle theControl, long param );
  78. void SliderCreateOffscreenWorld( ControlHandle theControl );
  79. void SliderDrawControlParts( ControlHandle theControl );
  80.  
  81. // SliderDisposeControl.c
  82. void SliderDisposeControl( short varCode, ControlHandle theControl, long param );
  83.  
  84. // SliderPositionControl.c
  85. void SliderPositionControl( short varCode, ControlHandle theControl, long param );
  86.  
  87. // SliderThumbControl.c
  88. void SliderThumbControl( short varCode, ControlHandle theControl, long param );
  89.  
  90. // SliderDragControl.c
  91. long SliderDragControl( short varCode, ControlHandle theControl, long param );
  92. OSErr VBLTaskSetup( void );
  93. OSErr RemoveVBLTask( void );
  94. void MyVBLTask( void );
  95.  
  96. // SliderCalcCntlRgn.c
  97. void SliderCalcCntlRgn( short varCode, ControlHandle theControl, long param );
  98.  
  99. // SliderCalcThumbRgn.c
  100. void SliderCalcThumbRgn( short varCode, ControlHandle theControl, long param );
  101.  
  102. // SliderUtils.c
  103. Rect CalcThumbRect( ControlHandle theControl );
  104. void SliderGetControlColors( ControlHandle theControl, SliderColors *colors );
  105. Boolean IsHorizontal( ControlHandle theControl );